#ifndef SIG_RECIVER_HPP
#define SIG_RECIVER_HPP
#include "signal.hpp"
class sigReciver{
public:
    virtual ~sigReciver(){
        //存储所有自己绑定的信号，当自己析构时，通知信号
        for(std::weak_ptr<SIG::AbsSignal>& w: m_signals){
			auto s = w.lock();
            if(s)
			    s->deleteReciver((void*)this);
		}
    }
public:
    template<typename T>
	void recordSignal(T v){
		m_signals.push_back(v);
	}
protected:
    std::list<std::weak_ptr<SIG::AbsSignal>> m_signals;
};
#endif